package sg.edu.nus.iss.team2s.jass.dao;

import java.util.List;
import java.util.Map;

public abstract class AbstractPropertiesDAO implements DAOInterface {

	public abstract void add(Object obj) throws DAOException;

	public abstract Object get(String key) throws DAOException;

	public abstract List<Object> list() throws DAOException;

	public abstract void update(List<Object> list) throws DAOException;
	
	//get the fields, need to be overridden in the subclass
	protected String[] getFields(){
		return new String[]{"id","name","branchId"};
	}
	
	//flush objects to properties file
	protected void flush(Map<String, String> objects, String fileName){
		String[] fields = getFields();
		
	}
	
	//retrieve objects from properties file
	protected Map<String, String> retrieve(String fileName){
		String[] fields = getFields();
		Map<String, String> objects = null;
		
		return objects;
	}
}
